#ifndef RESOURCE_H
#define RESOURCE_H

#include <string>
#include "bga/system/ConfigDLL.h"

/**
 * \namespace bga
 * \brief API namespace
 */
namespace bga
{

/**
 * \brief this class defines a resource
 */
class BOARD_HELL_ENGINE Resource
{
    protected:
        Resource(const std::string& name = "");

    public:
        virtual ~Resource();

        /**
         * \brief get the name of the resource
         * \return the name of the resource
         */
        const std::string& getName() const;

        /**
         * \brief add a reference on the current resource
         */
        void addRef();

        /**
         * \brief remove a reference and destroy the current resource if needed
         */
        void release();

    private:
        std::string name;
        unsigned int refCount;  /// Intrusive counter


};

}

//#include "bga/system/Resource.inl"

#endif // RESOURCE_H

